//
//  ShipmentTableViewCell.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/23.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "ShipmentTableViewCell.h"

#import "MyListNumView.h"
#import "ShoppingImageScrollView.h"
#import "InterFace.h"
#import "Shipments_View.h"
#import "UIViewAdditions.h"

@implementation ShipmentTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        //订单号
        self.listNumber = (MyListNumView *)[[[NSBundle mainBundle] loadNibNamed:@"Shopping_list_xibs" owner:self options:nil] objectAtIndex:0];
        self.listNumber.frame = CGRectMake(0, 0, SCREEN_WIDTH, 80);;
        [self.contentView addSubview:self.listNumber];
        
        //已支付
        self.state = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-100, 20, 80, 30)];
        self.state.text = @"已发货";
        _state.layer.masksToBounds = YES;
        _state.layer.cornerRadius = 15/2.0;
        _state.textAlignment = NSTextAlignmentCenter;
        _state.backgroundColor = LineColor;
        [self.contentView addSubview:self.state];
        
        
        //线条
        UILabel *lineView = [[UILabel alloc] initWithFrame:CGRectMake(10, self.listNumber.bottom+5, SCREEN_WIDTH-20, 1)];
        lineView.backgroundColor = LineColor;
        
        [self.contentView addSubview:lineView];
        
        //商品滑动图片
        CGRect rect = CGRectMake(0, self.listNumber.bottom+10 , SCREEN_WIDTH, 100);
        self.shoppingImageScrollView = [ShoppingImageScrollView  soppingImageScrollViewWithFrame:rect data:nil];
        self.shoppingImageScrollView.contentSize = CGSizeMake(SCREEN_WIDTH*2, 100);
        [self.contentView addSubview:self.shoppingImageScrollView];
        
        //线条
        UILabel *lineView2 = [[UILabel alloc] initWithFrame:CGRectMake(10, self.shoppingImageScrollView.bottom+5, SCREEN_WIDTH-20, 1)];
        lineView2.backgroundColor = LineColor;
        [self.contentView addSubview:lineView2];
        
        //订单状态
        self.shipmentsView= (Shipments_View *)[[[NSBundle mainBundle] loadNibNamed:@"Shopping_list_xibs" owner:self options:nil] objectAtIndex:4];
        self.shipmentsView.frame = CGRectMake(0, lineView2.bottom+10, SCREEN_WIDTH, 80);
        [self.contentView addSubview:self.shipmentsView];
        
    }
    return self;
}

@end
